<%-- 
    Document   : index
    Created on : 03-04-2010, 11:09:26 PM
    Author     : Eduardo Cerritos
--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>EME:Envio de notas</title>
        <link href="../css/estilos.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" language="javascript" src="../js/utilidades.js"></script>
        <%@ page import="java.util.*" %>
        <%@ page import="beans.*" %>
        <jsp:useBean id="Materias" scope="request" class="databeans.MateriaDataBean" />
        <%
            String codigo = request.getParameter("codigo");
        %>
    </head>
    <body>
        <sec:authorize ifAnyGranted="ROLE_SYSTEM,ROLE_DOCENTE">
        <table  border="0" width="100%">
            <thead>
                <tr>
                    <th >
                        <h1><img alt="eMe" src="../images/EME2.png" width="175px"></h1>
                    </th>
                    <th >
                        <h1><img alt="envio de Notas" src="../images/headers/envioDeNotas.png"></h1>
                    </th>
                </tr>
            </thead>
            <tbody>

                <tr>
                    <td width="200px" valign="top">
                        <%@ include file="menu.jsp" %>
                    </td>
                    <td><center>
                        <form method="post" onsubmit="return validaForm(this)" action="../cargar" enctype="multipart/form-data">
                            <table>
                                <tr>
                                    <th><label for="opcion">Forma de envio:</label></th>
                                    <td><input type="radio" name="opcion" value="1" />Email
                                        <input type="radio" name="opcion" value="2" />Sms
                                        <input type="radio" name="opcion" value="3" />Ambos
                                    </td>
                                </tr>
                                <tr>
                                    <th><label for="materia">Materia</label></th>
                                    <td><select id="materia" name="materia">
                                    <sec:authorize ifAllGranted="ROLE_SYSTEM">
                                        <%
                                    List listaMat = Materias.getMateriasCicloActual();
                                    Iterator it = listaMat.iterator();
                                    while (it.hasNext()){
                                        MateriaBean materia = (MateriaBean)it.next();

                                    %>
                                            <option value="<%= materia.getCodMateria()%>"><%= materia.getNomMateria()%></option>
                                    <%
                                    }
                                    %>
                                    </sec:authorize>
                                    <sec:authorize ifAllGranted="ROLE_DOCENTE">
                                        <%
                                    List listaMate = Materias.getListaMateriasByDocente(codigo);
                                    Iterator ite = listaMate.iterator();
                                    while (ite.hasNext()){
                                        MateriaBean materia = (MateriaBean)ite.next();

                                    %>
                                            <option value="<%= materia.getCodMateria()%>"><%= materia.getNomMateria()%></option>
                                    <%
                                    }
                                    %>
                                    </sec:authorize>
                                        </select></td>
                                </tr>
                                <tr><th><label for="archivo">Archivo de notas:</label></th>
                                    <td><input id="archivo" type="file" name="fileUploaded" /></td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td><button type="submit">Enviar</button></td>
                                </tr>
                            </table>
                        
                        </form>
                        </center>
                    </td>
                </tr>
            </tbody>
        </table>
        <div align="left">
        <jsp:include page="barrausuario.jsp"/>
        </div>
        </sec:authorize>
    </body>
</html>
